/**
 * @param {String} title
 * @description 设置页面标题
 */
export const setTitle = (title) => {
  window.document.title = title || '纳雍教育资助'
}

/**
 * @param {String} urlName
 * @description 从URL中解析参数
 */
export const getParams = urlName => {
  const reg = new RegExp(`(^|&)${urlName}=([^&]*)(&|$)`)
  let r = window.location.search.substr(1).match(reg)
  if (r !== null) return unescape(r[2]); return null
}
